var koa = require("koa");
var Router = require("koa-router")

var app = new koa();
var router = new Router();


router.get('/', async (ctx)=> {
    ctx.body = "this is index";
}).get('/news', async (ctx)=>{
    ctx.body = "新闻列表";
}).get('/newsContent/:id/:aid', async (ctx)=>{

// 获取动态路由
    console.log(ctx.params);

    ctx.body = ctx.params;
})

app.use(router.routes());
app.use(router.allowedMethods);


app.listen(3000);


